/**
 * @Project TMHSCFX
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 11, 2011
 * @Createtime 8:13:24 PM
 */

package com.tmh.study.a3D36E
{
	import away3d.core.geom.Path;
	import away3d.extrusions.PathExtrusion;

	import flash.geom.Vector3D;

	public class PathExtrusionDemo extends Away3DTemplate
	{
		public function PathExtrusionDemo()
		{
			super();
		}

		protected override function initScene():void
		{
			super.initScene();
			camera.position = new Vector3D(0, 500, 500);
			camera.lookAt(new Vector3D(0, 0, 0));

			var path:Path = new Path([new Vector3D(-150, 0, 0),
				new Vector3D(-100, 0, 75),
				new Vector3D(0, 0, 0),
				new Vector3D(0, 0, 0),
				new Vector3D(100, 0, -75),
				new Vector3D(150, 0, 0)]);

			var profile:Array = [new Vector3D(0, -200, 0),
				new Vector3D(0, 200, 0)];

			var extrusion:PathExtrusion = new PathExtrusion(path, profile, null, null, {bothsides: true,
					subdivision: 6});

			scene.addChild(extrusion);
		}
	}
}